/*
 * feature.h
 *
 *  Created on: Aug 26, 2011
 *      Author: tpz22rc
 */

#ifndef FEATURE_H_
#define FEATURE_H_
class Feature{
public:
	Feature(){}
	~Feature(){}

	double max(double *a,const int &size){
		double *r=&a[1];
		for(int i=1;i<=size;i++){
			if(*r<a[i]){
				r=&a[i];
			}
		}
		return *r;
	}

	double min(double *a,const int &size){
		double *r=&a[1];
		for(int i=1;i<=size;i++){
			if(*r>a[i]){
				r=&a[i];
			}
		}
		return *r;
	}
	double max(double a,double b,double c){
		int i;
		double f[3];
		f[0]=a;f[1]=b;f[2]=c;
		double *r=&f[0];
		for(i=0;i<3;i++){
			if(*r<f[i]){
				r=&f[i];
			}
		}
		return *r;
	}

	double min(double a,double b,double c){
		int i;
		double f[3];
		f[0]=a;f[1]=b;f[2]=c;
		double *r=&f[0];
		for(i=0;i<3;i++){
			if(*r>f[i]){
				r=&f[i];
			}
		}
		return *r;
	}
};

#endif /* FEATURE_H_ */
